home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXT Education Software Sampler 1992 Fall
/
NeXT Education Software Sampler 1992 Fall.iso
/
SoundAndMusic
/
cmix
/
lib
/
tablei.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-06
|
359b
|
17 lines
float tablei(nsample,array,tab)
long nsample;
float *array,*tab;
{
register loc1,loc2;
float frac = ((float)(nsample)/(*tab)) * *(tab+1);
if(frac < 0) return(array[0]);
if(frac >= *(tab+1)) return(array[(int)*(tab+1)]);
loc1 = frac;
loc2 = loc1+1;
frac = frac - (float)loc1;
return(*(array+loc1) + frac * (*(array+loc2) - *(array+loc1)));
}